<script>
jQuery(document).ready(function(){
//切换商品
	jQuery("a[id^=favorite_a_]").click(function(){
		 var obj_id =jQuery(this).attr("obj_id");
		 var goods_id =jQuery(this).attr("goods_id");
		 jQuery("#goods_id").val(goods_id);
		 jQuery("li[id^=favorite_li_]").removeClass("this");
		 jQuery("#favorite_li_"+obj_id).addClass("this");
												
	});								
});
</script>

<ul>
        #foreach($fav in $favorites)     #set($f_img="$!webPath/$!{fav.goods.goods_main_photo.path}/$!{fav.goods.goods_main_photo.name}_small.$!{fav.goods.goods_main_photo.ext}")
         <li #if($!velocityCount==1)class="this"#end  goods_id="$!fav.goods.id"  id="favorite_li_$!fav.id">
         <a href="javascript:void(0);" id="favorite_a_$!fav.id" obj_id="$!fav.id" goods_id="$!fav.goods.id">
         <img src="$!f_img" width="60" height="60" />
         </a></li>
         #end
               <input id="fcurrentCount" name="fcurrentCount" type="hidden" value="$!fcurrentCount"/>
        </ul>